{extend name="$base" /}
{block name="resources"}
<link rel="stylesheet" type="text/css" href="WEB_CSS/goods_cart.css">
<link type="text/css" rel="stylesheet" href="WEB_CSS/like_and_history.css">
{/block}
{block name="main"}
{php}
	$data = api('System.Goods.cartList');
	$cart_list = $data['data']['cart_list'];
	$goods_ladder_preferential = $data['data']['goods_ladder_preferential'];
{/php}
{if condition="!empty($cart_list)"}
<div class="cart-list">
	<ul class="cart-head">
		<li>
			<div class="cart-check">
				<input type="checkbox" id="cheAll" checked="checked" autocomplete="off" onclick="cart.checked(this,'all')" />
				<label for="cheAll">{:lang('goods_select_all')}</label>
			</div>
			<span>{:lang('goods_product')}</span>
		</li>
		<li>{:lang('goods_shop_price')}</li>
		<li>{:lang('goods_number')}</li>
		<li>{:lang('goods_subtotal')}</li>
		<li>{:lang('goods_operation')}</li>
	</ul>
	<div class="cart-body">
		{foreach name="cart_list" item="cart_info" key="k"}
		<ul class="cart-head list-item ns-border-color-gray selected">
			<li data-goods-id="{$cart_info['goods_id']}">
				<input type="checkbox" value="{$cart_info.cart_id}"  name="select_check"  autocomplete="off" checked="checked" onclick="cart.checked(this,'one')"/>
				<a class="item-pic ns-border-color-gray" target="_blank" href="{:__URL('SHOP_MAIN/goods/detail','goods_id='.$cart_info['goods_id'])}">
					<img class="lazy" src="{:__IMG($default_goods_img)}" data-original="{:__IMG($cart_info['picture_info']['pic_cover_big'])}" />	
				</a>
				<a class="item-text" href="{:__URL('SHOP_MAIN/goods/detail','goods_id='.$cart_info['goods_id'])}" target="_blank">
					<span>{$cart_info.goods_name}</span>
				</a>
				<span class="sku-name ns-text-color-gray">{$cart_info.sku_name}</span>
			</li>
			<li class="price" data-promotion-price="{$cart_info['promotion_price']}">
				<span data-value="{$cart_info.price}" class="js_price_{$cart_info.cart_id}">￥{$cart_info.price}</span>
			</li>
			<li>
				<div class="item-counter">
					<span class="reduce ns-border-color-gray" onclick="cart.changeNumber(this)">-</span>
					<input type="text" class="num ns-border-color-gray" value="{$cart_info.num}"  min="{if condition='$cart_info.min_buy > 0'}{$cart_info.min_buy}{else/}1{/if}" max="{if condition='$cart_info.max_buy > 0'}{$cart_info.max_buy}{else/}{$cart_info.stock}{/if}"  onchange="cart.changeNumber(this,'change')" data-value="{$cart_info.num}"/>
					<span class="plus ns-border-color-gray" onclick="cart.changeNumber(this)">+</span>
				</div>
			</li>
			<li>
				<span id="subtotal_{$cart_info.cart_id}" data-total="{$cart_info.price*$cart_info.num}" class="sum">￥{$cart_info.price*$cart_info.num}</span>
			</li>
			<li>
				<span onclick="cart.deleteCart(this,'one')">{:lang('goods_delete')}</span>
			</li>
			<input type="hidden" name="sku_id" value="{$cart_info.sku_id}">
		</ul>
		{/foreach}
	</div>
	<div class="cart-foot ns-border-color-gray">
		<div class="foot-left">
			<div class="cart-check">
				<input  type="checkbox" id="cheAllOne" checked="checked" name="cheAllOne" onclick="cart.checked(this,'all')" />
				<label for="cheAllOne">全选</label>
			</div>
			<a onclick="cart.deleteCart(this,'selected')">删除选中的商品</a>
			<a onclick="cart.deleteCart(this,'all')">清除购物车</a>
		</div>
		<div class="foot-right">
			<span class="foot-text">
				总价 :<span class="total-price ns-text-color">￥200</span>
			</span> 
			<span class="settlement ns-bg-color" onclick="cart.Settlement()">{:lang('goods_settle_accounts')}</span>
		</div>
	</div>
</div>
<input type="hidden" value='{$goods_ladder_preferential}' id="hidden_goods_ladder_preferential" />
{else/}
<div class="cart-empty">
	<p>{:lang('goods_empty_and_look')}~</p>
	<a href="{:__URL('SHOP_MAIN')}" class="ns-text-color" title="{:lang('goods_go_shopping')}">{:lang('goods_go_shopping')}&gt;</a>
</div>
{/if}
<div id="history" class="carousel slide history" data-ride="carousel">
	<div class="wrap-head clear">
		<div class="tab">
			<ul>
				<li class="curr ns-text-color" data-type="history">我的足迹</li>
			</ul>
		</div>
	</div>	    
    <!-- 轮播项目 -->
   	<div class="carousel-container">
   		<div class="carousel-inner">    		
   		</div>
    	<div class="switch-box">		    		       	
		</div>
   	</div>   	 
   	<div class="empty-wai">      		
   	</div>
</div>
{/block}
{block name="script"}
<script src="WEB_JS/goods_cart.js"></script>
{/block}